How to Display “Yes” or “No” for a Yes/No Data Type Field
In this How To, I will show you how to display “Yes” or “No” for field with a data type of Yes/No. When you have a field with a Data Type of Yes/No and use a format of Yes/No, it will display a Checkbox with Check for Yes and Uncheck for No instead of word “Yes” or “No”.
Table design view of Yes/No Data Type field
Datasheet view of Yes/No Data Type field
The Check mark represents a “Yes” value on the Data Type field. The Uncheck box (blank) represents “No” value.
Display “Yes” or “No” from Query
We need to use the IIF function to convert the Check/Uncheck to “Yes” or “No”.
Active = IIF([CurrentActive] = -1, “Yes”, “No”)
Fieldname = CurrentActive
The value of “Yes” = -1
New name = Active
If the value Yes of field then displays “Yes”, if not displays “No”.
Display “Yes” or “No” on datasheet of query
Form view of Yes/No Data Type field
When the Yes/No Data Type field is added into the form, it will display a small square box with a check mark for a value of Yes and an empty square box for a value of No. You can check and uncheck on the square box. However, it doesn’t display Yes or No.
In order to display the result in form as Yes or No, you will need to add the Unbound textbox as shown in the picture below. Under the form design view,
- Double click the Unbound textbox to open the Property Sheet
- Click three dots (…)
- Select Expression Builder
- Add =IIF([CurrentActive] = -1, “Yes”, “No”)
- Click OK
Form view of Yes/No Data Type field using Unbound textbox
NOTE: The Yes or No is displayed depending on the value of this field, so it cannot be changed by the user.
The user can change the value only on the original Yes/No check box. If you add both Yes/No check box and the unbound textbox on the same form, the value of Yes or No on the unbound textbox will change when you check or uncheck the checkbox.
So this method is good for displaying “Yes” or “No” without making a change of the value such as on a report.